﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="{x:Type TabControl}" x:Key="StandardTabControl">
        <Style.Resources>
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="true" Height="23">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="25"/>
                                </Grid.ColumnDefinitions>
                                <Label x:Name="root" Foreground="{StaticResource Foreground}" >
                                    <ContentPresenter ContentSource="Header" Margin="10,0,10,0"
                                                      HorizontalAlignment="Center" VerticalAlignment="Center" />                                    
                                </Label>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="false">
                                    <Setter Property="Background" Value="Transparent"/>                                                                        
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" Value="{StaticResource BorderBrushSelected}"/>
                                </Trigger>
                                <Trigger Property="IsSelected" Value="true">
                                    <Setter Property="Background" Value="{StaticResource BackgroundSelected}"/>
                                    <Setter TargetName="root" Property="Foreground">
                                        <Setter.Value>
                                            <SolidColorBrush Color="White" />
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border Background="Transparent" BorderThickness="0,0,0,3" 
                                BorderBrush="{StaticResource BackgroundSelected}">
                            <TabPanel Name="HeaderPanel" Panel.ZIndex="1" Margin="0,0,4,-1" 
                                IsItemsHost="True" KeyboardNavigation.TabIndex="1"/>
                        </Border>                        
                        <ContentPresenter Grid.Row="1" Name="PART_SelectedContentHost" 
                                            ContentSource="SelectedContent" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="TabControl" BasedOn="{StaticResource StandardTabControl}" />
</ResourceDictionary>